package com.meida.module.bus.provider.handler;

import com.meida.common.base.entity.EntityMap;
import com.meida.common.mybatis.interceptor.GetInterceptor;
import com.meida.common.mybatis.query.CriteriaQuery;
import com.meida.module.bus.client.entity.BusScholartyrant;
import com.meida.module.user.client.entity.AppUser;
import org.springframework.stereotype.Component;

/**
 * 后台用户详情
 */
@Component
public class AppUserGetHandler implements GetInterceptor {

    @Override
    public void prepare(CriteriaQuery cq, EntityMap entityMap) {
        cq.clear();
        cq.select(AppUser.class, "userId", "userNo", "userType");
        cq.select(BusScholartyrant.class, "roleTagName");
        cq.createJoin(BusScholartyrant.class).setMainField("userId").setJoinField("scholartyrantId");
    }
}
